<?php 
class Country_Form_Admin_Countryfield_Create extends Engine_Form{
    public function init(){
        //$this->setTitle('Create New Field');
		$this//->setAttrib('id', 'form-manageads')
			//->setAttrib('name', 'mlm_form_banner_manageads')
			->setAttrib('enctype', 'multipart/form-data')
			->setAction(Zend_Controller_Front::getInstance()->getRouter()
			->assemble(array ()));
         
       
        /// add parent field
        $fieldTb  = Engine_Api::_()->getDbTable('fields', 'country');
        $parents = $fieldTb->getInfoField();
        $parent_list_array = array();
        if(count($parents) > 0){
            foreach($parents as $parent){
                $parent_list_array[$parent->field_id] = $parent->title;
            }
        }
        $this->addElement('Select','field_id',array(
            'label' => 'Select Field',            
            'multiOptions' => $parent_list_array
        ));
         
        /// add Title
        
        $this->addElement('TinyMce', 'detail', array(
            'label' => 'Detail',
            'required' => true,
            'allowEmpty' => false,
            'attribs' => array('rows' => 180, 'cols' => 350, 'style' => 'width:740px; max-width:740px;height:858px;'),
            'editorOptions' => array(
                    'plugins' => 'preview,table,layer,style,xhtmlxtras,media,advhr,paste,fullscreen,searchreplace',
                    'theme_advanced_buttons1' => "preview,code,|,pasteword,|,undo,redo,|,image,media,|,removeformat,cleanup,fullscreen",
                    'theme_advanced_buttons2' => "bold,italic,underline,strikethrough,|,bullist,numlist,|,outdent,indent,blockquote,|,justifyleft,justifycenter,justifyright,justifyfull,",
                    //'theme_advanced_buttons3' => "formatselect,fontselect,fontsizeselect,|,forecolor,backcolor,"
                    ),
            'filters' => array(
                    new Engine_Filter_Censor(),
                    new Engine_Filter_Html(array('AllowedTags' => "strong, b, em, i, u, strike, sub, sup, p, div, pre, address, h1, h2, h3, h4, h5, h6, span, ol, li, ul, a, img, embed, br, hr"))),
        ));
        
       
          
        $this->addElement('Button', 'submit', array (
			'type' => 'submit', 
			'label' => 'Save', 
			'decorators' => array (
					'ViewHelper'
			)
        ));
		
		$this->addElement('Cancel', 'cancel', array (
				'label' => 'cancel', 
				'link' => true, 
				'prependText' => Zend_Registry::get('Zend_Translate')->_(' or '), 
				'href' => '', 
				'onclick' => 'parent.Smoothbox.close();', 
				'decorators' => array (
						'ViewHelper'
				)
		));
		$this->addDisplayGroup(array (
				'submit', 
				'cancel'
		), 'buttons');
		$button_group = $this->getDisplayGroup('buttons');
    }
}
?>